home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Games of Daze
/
Infomagic - Games of Daze (Summer 1995) (Disc 1 of 2).iso
/
x2ftp
/
msdos
/
libs
/
knowhow4
/
trigon.cpp
< prev
next >
Wrap
C/C++ Source or Header
|
1994-11-20
|
445b
|
20 lines
#include "trigon.h"
#include <math.h>
Trigonometry::Trigonometry()
{
sin_table = new int[362];
for(double i = 0; i < 360; i++)
sin_table[i] = (int)(1000 * ::sin(M_PI * 2 * i / 360));
sin_table[360] = 0;
}
////////////////////////
int Trigonometry::sin(int alpha)
{
while(alpha > 360)
alpha -= 360;
while(alpha < 0)
alpha += 360;
return sin_table[alpha];
}
//////////////////////////